package org.loneranger.p1_get_bean.demo;

import org.loneranger.p1_get_bean.config.MyAnnotationConfig;
import org.loneranger.p1_get_bean.bean.MyUser;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;


/**
 * 通过注解@Bean的方式获取Bean
 *
 * @author loneranger
 */
public class AnnotationBeanTest {

	public static void main(String[] args) {

		AnnotationConfigApplicationContext applicationContext =
				new AnnotationConfigApplicationContext();
		applicationContext.register(MyAnnotationConfig.class);

		MyUser user = applicationContext.getBean("user", MyUser.class);

	}
}
